package io.jt808.proto.cmd;

import io.norland.buffer.AutoBuffer;
import io.norland.annotations.Proto;
import io.norland.proto.IProto;
import lombok.Data;

/**
 * 单条存储多媒体数据检索上传命令
 */
@Proto("8805")
@Data
public class JT8805 implements IProto {
    /**
     * 多媒体ID
     */

    private int multimediaId;
    /**
     * 删除标志
     */
    private byte deleteFlag;

    public final byte[] writeToBytes() {
        AutoBuffer buffer = new AutoBuffer();
        buffer.writeInt(multimediaId);
        buffer.writeByte(deleteFlag);
        return buffer.array();
    }

    public final void readFromBuf(AutoBuffer buffer) {
        multimediaId = buffer.readInt();
        deleteFlag = buffer.readByte();
    }
}